<template>
	<div>
		<Header title="商品出库"></Header>
		<div class="Order">
			<operate
				:isAddShow="isAddShow"
				:isSeniorShow="isSeniorShow"
			></operate>
			<table cellspacing="0">
				<tr>
					<th>出库单号</th>
					<th>出库门店</th>
					<th>出库类型</th>
					<th>出库数量</th>
					<th>经办人员</th>
					<th>制单人员</th>
					<th>制单日期</th>
					<th>审核状态</th>
					<th>---</th>
				</tr>
				<tr v-for="item in viewData" :key="item._id">
					<td>{{ item.no }}</td>
					<td>{{ item.store }}</td>
					<td>{{ item.type }}</td>
					<td>{{ item.quantity }}</td>
					<td>{{ item.person }}</td>
					<td>{{ item.maker }}</td>
					<td>{{ item.date }}</td>
					<td>{{ item.status }}</td>
					<td>
						<span>
							详情
						</span>
					</td>
				</tr>
				<tr>
					<td colspan="9" style="border:0;color:#000">
						<Footer></Footer>
					</td>
				</tr>
			</table>
		</div>
	</div>
</template>
<script>
import Header from "@/components/member/header"
import Footer from "@/components/member/footer"
import operate from "@/components/member/operate"
export default {
	data() {
		return {
			isAddShow: false,
			isSeniorShow: true,
			isExportShow: false,
			Data: [],
			viewData: [],
			totalNums: 0,
			totalPages: 0,
			pageNum: 1,
			url: "/gxjy/outof",
		}
	},
	methods: {
		getData() {
			this.$http.get(this.url + "/all").then(ret => {
				console.log(ret)
				// 全部数据
				this.Data = ret.data
				// 总数据条数
				this.totalNums = this.Data.length
				// 总页数
				this.totalPages = Math.ceil(this.totalNums / 10)
				// 可见的数据
				this.viewData = this.Data.splice((this.pageNum - 1) * 10, 10)
				this.$store.commit("common/setTotalNums",this.totalNums);
            this.$store.commit("common/setTotalPages",this.totalPages);
			})
		},
	},
	filters: {},
	beforeDestroy() {},
	created() {
		this.getData()
	},
	components: {
		Footer,
		Header,
		operate,
	},
}
</script>
<style lang="scss" scoped>
@import "@/assets/scss/table.scss";
</style>
